<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui"
                xmlns:sec="http://www.springframework.org/security/facelets/tags"
                template="../../templates/layout.xhtml"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                xmlns:arq="http://java.sun.com/jsf/composite/ezcomp">

    <ui:define name="content">
            <div class="formedit">
                <div class="formedit-head">
                    <h:outputText value="#{msg.alterarSenha}"/>
                </div>
                <h:panelGroup id="passChangeGroup">
                    <h:form id="passForm">
                        <h:panelGrid columns="3" style="font-size: 0.9em;" class="gridForm">

                            <h:outputLabel value="#{msg.atual}:" for="atual" />
                            <p:password id="atual" value="#{passwordController.senhaAtual}" size="20" 
                                        label="#{msg.atual}" 
                                        required="true" requiredMessage="#{msg.campoObrigatorio}" />
                            <p:message for="atual"/>

                            <h:outputLabel value="#{msg.senha}:" for="pass" />
                            <p:password id="pass" value="#{passwordController.senha}" match="pass2" size="20" weakLabel="#{msg.fraca}"
                                        goodLabel="#{msg.forte}" strongLabel="#{msg.muitoForte}" label="#{msg.senha}" feedback="true"
                                        required="true" requiredMessage="#{msg.campoObrigatorio}" promptLabel="#{msg.digiteSenha}"/>
                            <p:message for="pass"/>

                            <h:outputLabel value="#{msg.confirme}:" for="pass2" />
                            <p:password id="pass2" value="#{passwordController.senha}" size="20" required="true" weakLabel="#{msg.fraca}"
                                        goodLabel="#{msg.forte}" strongLabel="#{msg.muitoForte}" label="#{msg.confirme}"
                                        requiredMessage="#{msg.campoObrigatorio}"  promptLabel="#{msg.confirmeSuaSenha}"/>
                            <p:message for="pass2" />

                            <h:outputText value=""/>
                            <h:panelGroup id="buttons" styleClass="pagging">
                                <h:commandLink action="#{passwordController.alterarSenha()}" value="#{msg.salvar}" id="saveButton" >
                                </h:commandLink>
                                <h:commandLink action="principal" value="#{msg.cancelar}" 
                                               immediate="true" id="cancelButton" >
                                </h:commandLink>
                            </h:panelGroup>
                        </h:panelGrid>
                    </h:form>
                </h:panelGroup>
            </div>
    </ui:define>
</ui:composition>

